From: Giovanni Campagna Date: Sun, 20 Nov 2011 16:52:50 +0000 (+0100) Subject: Port GDM and Caribou to GDBus X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7279 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0996174b3d13f367cf9f5888e4a0b55e509df686;p=gnome-shell.git Port GDM and Caribou to GDBus During the mass port to GDBus, this classes were left out (probably because they didn't exist at the time). Now it's time to update them. https://bugzilla.gnome.org/show_bug.cgi?id=664436 --- diff --git a/js/gdm/consoleKit.js b/js/gdm/consoleKit.js index 99465cb76..6445a8c04 100644 --- a/js/gdm/consoleKit.js +++ b/js/gdm/consoleKit.js @@ -1,32 +1,22 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- -const DBus = imports.dbus; +const Gio = imports.gi.Gio; -const ConsoleKitManagerIface = { - name: 'org.freedesktop.ConsoleKit.Manager', - methods: [{ name: 'CanRestart', - inSignature: '', - outSignature: 'b' }, - { name: 'CanStop', - inSignature: '', - outSignature: 'b' }, - { name: 'Restart', - inSignature: '', - outSignature: '' }, - { name: 'Stop', - inSignature: '', - outSignature: '' }] -}; +const ConsoleKitManagerIface = + + + + + + + + +; -function ConsoleKitManager() { - this._init(); -}; +const ConsoleKitProxy = Gio.DBusProxy.makeProxyWrapper(ConsoleKitManagerIface); -ConsoleKitManager.prototype = { - _init: function() { - DBus.system.proxifyObject(this, - 'org.freedesktop.ConsoleKit', - '/org/freedesktop/ConsoleKit/Manager'); - } +function ConsoleKitManager() { + return new ConsoleKitProxy(Gio.DBus.system, + 'org.freedesktop.ConsoleKit', + '/org/freedesktop/ConsoleKit/Manager'); }; -DBus.proxifyPrototype(ConsoleKitManager.prototype, ConsoleKitManagerIface); diff --git a/js/gdm/fingerprint.js b/js/gdm/fingerprint.js index 9892ef8eb..9c090b08a 100644 --- a/js/gdm/fingerprint.js +++ b/js/gdm/fingerprint.js @@ -1,26 +1,20 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- -const DBus = imports.dbus; +const Gio = imports.gi.Gio; const Lang = imports.lang; const Shell = imports.gi.Shell; const Signals = imports.signals; -const FprintManagerIface = { - name: 'net.reactivated.Fprint.Manager', - methods: [{ name: 'GetDefaultDevice', - inSignature: '', - outSignature: 'o' }] -}; +const FprintManagerIface = + + + +; -function FprintManager() { - this._init(); -}; +const FprintManagerProxy = Gio.DBusProxy.makeProxyWrapper(FprintManagerIface); -FprintManager.prototype = { - _init: function() { - DBus.system.proxifyObject(this, - 'net.reactivated.Fprint', - '/net/reactivated/Fprint/Manager'); - } +function FprintManager() { + return new FprintManagerProxy(Gio.DBus.system, + 'net.reactivated.Fprint', + '/net/reactivated/Fprint/Manager'); }; -DBus.proxifyPrototype(FprintManager.prototype, FprintManagerIface); diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 810920617..0113dc8c9 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -33,7 +33,6 @@ const St = imports.gi.St; const GdmGreeter = imports.gi.GdmGreeter; const Batch = imports.gdm.batch; -const DBus = imports.dbus; const Fprint = imports.gdm.fingerprint; const Lightbox = imports.ui.lightbox; const Main = imports.ui.main; @@ -908,7 +907,7 @@ const LoginDialog = new Lang.Class({ if (!this._settings.get_boolean(_FINGERPRINT_AUTHENTICATION_KEY)) return; - this._fprintManager.GetDefaultDeviceRemote(DBus.CALL_FLAG_START, Lang.bind(this, + this._fprintManager.GetDefaultDeviceRemote(Gio.DBusCallFlags.NONE, Lang.bind(this, function(device, error) { if (!error && device) this._haveFingerprintReader = true; diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 2bf7868c2..a427f17ba 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -39,28 +39,27 @@ const PRETTY_KEYS = { 'Alt_L': 'Alt' }; -const CaribouKeyboardIface = { - name: 'org.gnome.Caribou.Keyboard', - methods: [ { name: 'Show', - inSignature: 'u', - outSignature: '' - }, - { name: 'Hide', - inSignature: 'u', - outSignature: '' - }, - { name: 'SetCursorLocation', - inSignature: 'iiii', - outSignature: '' - }, - { name: 'SetEntryLocation', - inSignature: 'iiii', - outSignature: '' - } ], - properties: [ { name: 'Name', - signature: 's', - access: 'read' } ] -}; +const CaribouKeyboardIface = + + + + + + + + + + + + + + + + + + + +; function Key() { this._init.apply(this, arguments); @@ -200,7 +199,8 @@ function Keyboard() { Keyboard.prototype = { _init: function () { - DBus.session.exportObject('/org/gnome/Caribou/Keyboard', this); + this._impl = Gio.DBusExportedObject.wrapJSObject(CaribouKeyboardIface, this); + this._impl.export(Gio.DBus.session, '/org/gnome/Caribou/Keyboard'); this.actor = null; @@ -533,7 +533,6 @@ Keyboard.prototype = { return 'gnome-shell'; } }; -DBus.conformExport(Keyboard.prototype, CaribouKeyboardIface); const KeyboardSource = new Lang.Class({ Name: 'KeyboardSource', diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js index 2804da3f1..4173c7353 100644 --- a/js/ui/status/accessibility.js +++ b/js/ui/status/accessibility.js @@ -1,6 +1,5 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- -const DBus = imports.dbus; const GDesktopEnums = imports.gi.GDesktopEnums; const Gio = imports.gi.Gio; const Gtk = imports.gi.Gtk;